﻿using log4net.Core;
using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Collections.ObjectModel;

namespace HobSoft.SoccerBet2014.Server.Log
{
    public class LogCacheCollection
    {
        public LogCacheCollection(BindingList<LoggingEvent> bindCollection, uint bindMaxCount, Form bindCollectionOwner, Func<LoggingEvent, bool> bindCheck)
        {
            _collectionOwner = bindCollectionOwner;
            _collection = bindCollection;
            _addCheck = bindCheck;
            _maxQueueCount = bindMaxCount;
        }

        public readonly object SyncRoot = new object();

        private readonly uint _maxQueueCount;
        public uint MaxQueueCount
        {
            get
            {
                return _maxQueueCount;
            }
        }

        private readonly Form _collectionOwner;
        public Form CollectionOwner
        {
            get
            {
                return _collectionOwner;
            }
        }

        private readonly BindingList<LoggingEvent> _collection;
        public BindingList<LoggingEvent> Collection
        {
            get
            {
                return _collection;
            }
        }

        private readonly Func<LoggingEvent, bool> _addCheck;
        public Func<LoggingEvent, bool> AddCheck
        {
            get
            {
                return _addCheck;
            }
        }
    }
}
